﻿using System.ComponentModel;
using Loki.Game;
using Loki.Utilities;

namespace toNyxIncinerate
{
    public class AbilitySettings : JsonSettings
    {

        private static AbilitySettings _instance;

        /// <summary>The current instance for this class. </summary>
        public static AbilitySettings Instance
        {
            get { return _instance ?? (_instance = new AbilitySettings()); }
        }

        public AbilitySettings()
            : base(GetSettingsFilePath(@"Combat Routines\toNyxIncinerate", string.Format("{0} - {1}.json", LokiPoe.ObjectManager.Me.League, LokiPoe.ObjectManager.Me.Name)))
        {

        }

        #region Settings Init

        private bool _useFireStorm;
        private bool _useProjectileWeakness;
        private int _projectileWeaknessMinEnemies;
        private bool _useArcticArmour;
        private float _combatRange;
        private int _ticksPerSeconds;

        #endregion

        #region Get / Set

        /// <summary>Get / Set FireStorm Usage</summary>
        [DefaultValue(false)]
        public bool UseFireStorm
        {
            get { return _useFireStorm; }
            set
            {
                if (value.Equals(_useFireStorm))
                    return;

                _useFireStorm = value;
                NotifyPropertyChanged(() => UseFireStorm);
            }
        }

        /// <summary>Get / Set ProjectileWeakness Usage</summary>
        [DefaultValue(false)]
        public bool UseProjectileWeakness
        {
            get { return _useProjectileWeakness; }
            set
            {
                if (value.Equals(_useProjectileWeakness))
                    return;

                _useProjectileWeakness = value;
                NotifyPropertyChanged(() => UseProjectileWeakness);
            }
        }

        /// <summary>Get / Set Projectile Weakness Reqs.</summary>
        [DefaultValue(4)]
        public int ProjectileWeaknessMinimumEnemies
        {
            get { return _projectileWeaknessMinEnemies; }
            set
            {
                if (value.Equals(_projectileWeaknessMinEnemies))
                    return;

                _projectileWeaknessMinEnemies = value;
                NotifyPropertyChanged(() => ProjectileWeaknessMinimumEnemies);
            }
        }

        /// <summary>Get / Set Arctic Armour Usage</summary>
        [DefaultValue(false)]
        public bool UseArcticArmour
        {
            get { return _useArcticArmour; }
            set
            {
                if (value.Equals(_useArcticArmour))
                    return;

                _useArcticArmour = value;
                NotifyPropertyChanged(() => UseArcticArmour);
            }
        }

        /// <summary>Get / Set Combat Range</summary>
        [DefaultValue(14)]
        public float CombatRange
        {
            get { return _combatRange; }
            set
            {
                if (value.Equals(_combatRange))
                    return;

                _combatRange = value;
                NotifyPropertyChanged(() => CombatRange);
            }
        }

        /// <summary>Get / Set TPS</summary>
        [DefaultValue(20)]
        public int TicksPerSeconds
        {
            get { return _ticksPerSeconds; }
            set
            {
                if (value.Equals(_ticksPerSeconds))
                    return;

                _ticksPerSeconds = value;
                NotifyPropertyChanged(() => TicksPerSeconds);
            }
        }

        #endregion

    }
}
